@extends('admin._layouts.default')

@section('main')


      <div class="row-fluid ">
        <div class="span12 box gradient ">
      <div class="title">
            <div class="row-fluid">
                <h3>
                    <a href="{{ URL::route('admin.suits.create') }}"  class="btn btn-info btn-mini pull-right" style="margin:5px 5px 0 0">
                    <i class="fa fa-plus"></i> 新增</a>
                  <i class="fa fa-archive"></i> 套装管理
                </h3>
            </div>
        </div><!-- End .title -->
        <div class="content">

        <ul class="thumbnails row-fluid">
            @foreach($suits as $key => $suit)
            <li class="span3">
                <div class="btn-group">
                <a href="{{ route('admin.suits.edit',$suit['id']) }}" rel="tooltip" data-placement="top" data-original-title="修改">
                <i class="fa fa-edit"></i>
                </a>
                <a data-toggle="modal" href="#confirm_alert" rel="tooltip" data-placement="top" data-original-title="终止">
                    @if($suit->status == 1)
                        <i class="fa fa-pause"></i>
                    @else
                        <i class="fa fa-play"></i>
                    @endif
                </a>
                <a data-toggle="modal" href="#confirm_alert" rel="tooltip" data-placement="top" data-original-title="删除套装">
                <i class="fa fa-trash"></i>
                </a>
                </div>
                <a class="thumbnail" data-toggle="modal" onclick="ajax_load('{{ $suit->id }}')" href="#info_view">
                <img alt="{{ $PATH.$suit->dec }}" src="{{ $PATH.$suit->cover }}-suits">
                </a>
            </li>
                @if(($key+1) % 4 ==0 )
                  </ul>
                  <ul class="thumbnails row-fluid">
                @endif
            @endforeach
        </ul>

          <!-- 模态开始 -->
          <div id="info_view" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-sm">
              <div class="modal-content">
                <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                  <h3 class="modal-title" id="myModalLabel">查看套装信息</h3>
                </div>
                <div class="modal-body" id="ajax_clothers">
                <img src="{{ URL::asset('web/img/ajax-loader.gif') }}">
                </div>
                <div class="modal-footer">
                  <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                  <button type="button" class="btn btn-primary">确定</button>
                </div>
              </div>
            </div>
          </div>

          <div id="confirm_alert" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-sm">
              <div class="modal-content">
                <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                  <h3 class="modal-title" id="myModalLabel">确定本次操作吗？</h3>
                </div>
                <div class="modal-body">
                  <i class=" icon-warning-sign color_red pull-left fs_24"></i>

                  <p>一旦【确定】，本次操作不可撤销。</p>

                </div>
                <div class="modal-footer">
                  <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                  <button type="button" class="btn btn-primary">确定</button>
                </div>
              </div>
            </div>
          </div>
          <!-- 模态结束 -->

            </div>
        </div>
        <!-- End box -->
      </div>


@stop

@section('script')
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/jquery.peity.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/jquery.uniform.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/chosen/chosen/chosen.jquery.min.js') }}"></script>

<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/flot/jquery.flot.js') }}"></script>



<script src="{{ URL::asset('web/js/scripts.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/jnavigate.jquery.min.js') }}"></script>
<script>
function ajax_load(id){
    var img = '<img src="{{ URL::asset('web/img/ajax-loader.gif') }}">';
    $('#ajax_clothers').html(img);

    $.post('{{ URL::route('admin.suits.ajax') }}',{id : id},function(data){
        $('#ajax_clothers').html(data);
    });
}
</script>
@stop
